from __future__ import print_function
from constraint_solver import pywrapcp

import sys

fichier = sys.argv[1]

import data8

solver = pywrapcp.Solver('curriculum1a')
nombreModule = solver.IntVar(data8.s*data8.minM, data8.s*data8.maxM,"nombreModule")
cursusUniv = [data8.s,nombreModule ]

module = solver.IntVar(data8.minM, data8.maxM)

credit = solver.IntVar(data8.minC, data8.maxC)
semestre = [(module, credit)]

nbCredit = 0

solver.Count([semestre[(j)] for j in range (0,len(semestre))], semestre[(j)][1], nbCredit)
# len(module >= minM
# len(module <= maxM
solver.Add(len(module) >= minM)
solver.Add(len(module) <= maxM)

solver.Add(len(credit) >= minC)
solver.Add(len(credit) <= maxC)

